import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dark_mode_getx_demo/pages/my_home_page.dart';
import 'package:flutter_dark_mode_getx_demo/theme/app_theme_manager.dart';
import 'package:get/get.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await SpUtil.getInstance();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(brightness: Brightness.light),
      darkTheme: ThemeData(brightness: Brightness.dark),
      themeMode: AppThemeManager.getLocalThemeMode(),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}
